home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / New System Software Extensions / PlainTalk™ Speech Technologies / Text To Speech / Programming Stuff / Examples / WannaSpeech / WannaSpeech.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-15  |  2.7 KB  |  82 lines  |  [TEXT/KAHL]

  1. /* This file contains all the defs and protos for the speech additions to AppWannaBe.
  2.    The idea is to show them separate so that it is easy to find them and it is also easy
  3.    to see what is different from the original sample code.
  4.    
  5.    Written by:    Guillermo A. Ortiz        AppleSoft Developer Technical Support
  6.    Date:        08/04/93
  7. */
  8. #ifndef __WANNASPEECH__
  9. #define __WANNASPEECH__
  10.  
  11. #include <Speech.h>
  12. #include <StdTTS.h>
  13.  
  14. /* this is used to keep track of the location of the next spoke word */
  15. struct WordLimits{
  16.     Boolean hilite;
  17.     short    wordStart;
  18.     short    wordEnd;
  19. };
  20. typedef struct WordLimits WordLimits;
  21. typedef WordLimits *WordLimitsPtr;
  22. typedef WordLimitsPtr *WordLimitsHandle;
  23.  
  24. #define     soGalaSynthID         'gala'
  25. #define     soGalaConvertToAllo 'cval'    // Convert to allophones.
  26.  
  27. typedef struct    GTXtndData {            // Extended info for several selectors.
  28.     OSType        synthID;                // soGalaSynthID ('gala').
  29.     OSType        selector;                // Extended selector (e.g. 'frac').
  30.     long        info2;                    // Extended information or pointer to it.
  31. } GTXtndData;
  32.  
  33.  
  34. typedef struct    GTXtndConvertData {    // Extended info for conversion selectors.
  35.         // input values
  36.     OSType        synthID;                // soGalaSynthID ('gala').
  37.     OSType        selector;                // Extended selector ('cval' or 'cvwv').
  38.     Ptr            inputBuffer;            // Address of the data to convert.
  39.     long        inputLen;                // Length of the data to convert.
  40.     long        controlFlags;            // 0 (for last buffer) or kNoEndingProsody.
  41.     Handle        outputBuffer;            // Handle to buffer for the output.
  42.         // return values
  43.     long        outputLen;                // Returns the size of the output.
  44.     Boolean        moreOutput;                // Returns true if outputBuffer is too small
  45.                                         //     for all the output at at once.
  46. } GTXtndConvertData;
  47.  
  48.  
  49. #define    mSpeech        131
  50. #define    kSayIt        1
  51. #define    kMakePhonemes        2
  52. #define    kMakeAllophones        3
  53. #define    kPickVoice    5
  54.  
  55. #define kTextCtl    100
  56. #define kPhonemeCtl    101
  57. #define kPhonemeLst    102
  58. #define kVoiceName    103
  59. #define kModeName    104
  60.  
  61. #define aVoiceFailed 300
  62.  
  63. /************** WannaSpeech.c **************/
  64.  
  65. void             DoSayIt(FileRecHndl frHndl);
  66. void             DoMakePhonemes(FileRecHndl frHndl);
  67. void             DoMakeAllophones(FileRecHndl frHndl);
  68. ComponentInstance OpenStdTTS(void);
  69. void SetVoice(FileRecHndl frHndl);
  70. void             CreatePhonemesList(WindowPtr wind);
  71. Boolean         SpeechAvailable(void);
  72. pascal void     MyWordCallback(SpeechChannel sChannel, WordLimitsPtr wLP, long wordPos, short wordLen);
  73. OSErr             SayText(FileRecHndl frHndl, TEHandle teH);
  74. void             InitDocSpeech(FileRecHndl frHndl);
  75. void SetTECtlText(WindowPtr window, FileRecHndl frHndl, short ctlNumber, Str255 pstr);
  76. pascal OSErr TextToAllophones(SpeechChannel channel, Ptr textBuf, long textBytes, Handle allophoneBuf, long *allophoneBytes);
  77.  
  78. /************** Menus.h ********************/
  79. Boolean            DoAdjustSpeechMenu(WindowPtr window);
  80.  
  81. #endif
  82.